import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/fonts/iconfont.css'
import './assets/css/base.css'
import 'amfe-flexible'
import { getToken } from '@utils'
import { Icon, Tabbar, TabbarItem, Swipe, SwipeItem, Grid, GridItem, List, PullRefresh, NavBar, GoodsAction, GoodsActionIcon, GoodsActionButton, Popup, Card, Stepper, Button, Form, Field, Toast, Checkbox, SwipeCell, SubmitBar, Dialog, ContactCard, Cell, Switch, Area, AddressList, Search, Lazyload } from 'vant'
import $loading from '@plugins/loading'

Vue.prototype.getToken = getToken
Vue.use($loading)
Vue.use(Icon)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(List)
  .use(PullRefresh)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Stepper)
  .use(Button)
  .use(Form)
  .use(Field)
  .use(Toast)
  .use(Checkbox)
  .use(SwipeCell)
  .use(SubmitBar)
  .use(Dialog)
  .use(ContactCard)
  .use(Cell)
  .use(Switch)
  .use(Area)
  .use(AddressList)
  .use(Search)
  .use(Lazyload, {
    preload: 1,
    loading: require('./assets/imgs/loading.jpg'),
    error: require('./assets/imgs/error.jpg'),
    attempt: 3
  })
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
